home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 63 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: csus.edu!NewsWatcher!user
  2. From: vreeland@sfsu.edu (Robert W. Vreeland Jr.)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Datatypes - Help!
  5. Date: Mon, 01 Jan 1996 14:17:24 -0800
  6. Organization: California State University Sacramento
  7. Message-ID: <vreeland-0101961417240001@192.0.2.1>
  8. NNTP-Posting-Host: vreeland@orion.sfsu.edu
  9.  
  10.  
  11.  
  12. Help!  I'm trying to load in and display a picture using datatypes.  The
  13. picture is loaded in and decoded but I can't display it because I always
  14. get a Bitmap pointer back of NULL.  What is wrong with this code?  (I can
  15. display a test image just fine with multiview so I know the image and the
  16. datatype are okay.  The problem has to lie in my code.)
  17.  
  18.  
  19.    if (!DataTypesBase)
  20.       return(1);
  21.    if (!(o=NewDTObject(path,DTA_GroupID,GID_PICTURE,
  22.                             TAG_END)))
  23.       return(1);
  24.    ilbm->dtf.MethodID=DTM_FRAMEBOX;
  25.    ilbm->dtf.dtf_GInfo=NULL;
  26.    ilbm->dtf.dtf_FrameInfo=&ilbm->fri;
  27.    ilbm->dtf.dtf_ContentsInfo=&ilbm->fri;
  28.    ilbm->dtf.dtf_SizeFrameInfo=sizeof(struct FrameInfo);
  29.    ilbm->dtf.dtf_FrameFlags=0L;
  30.    if (!DoMethodA(o,(Msg)&ilbm->dtf)) {
  31.       DisposeDTObject(o);
  32.       return(1);
  33.    }
  34.    ilbm->gpl.MethodID=DTM_PROCLAYOUT;
  35.    ilbm->gpl.gpl_GInfo=NULL;
  36.    ilbm->gpl.gpl_Initial=1L;
  37.    if (!DoMethodA(o,(Msg)&ilbm->gpl)) {
  38.       DisposeDTObject(o);
  39.       return(1);
  40.    }      
  41.    GetDTAttrs(o,PDTA_ModeID,&ilbm->modeid,
  42.                 PDTA_CRegs,&ilbm->cregs,
  43.                 PDTA_NumColors,&ilbm->numcolors,
  44.                 PDTA_BitMapHeader,&ilbm->bmhd,
  45.                 PDTA_BitMap,&ilbm->bm,TAG_END);
  46.    if (!ilbm->bm) {             ...we always get NULL back from the datatype?
  47.       DisposeDTObject(o);
  48.       return(1);
  49.    }      
  50.  
  51.  
  52. Thanks in advance,
  53.  
  54. Robert.
  55.